﻿using System;
using Coolite.Ext.Web;
using CooliteExamples.Web.Extensions;

namespace CooliteExamples.Web
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest && !IsPostBack)
            {
                LoadPage();
            }
        }

        private void LoadPage()
        {
            // set all menu item urls from the ProcessController
            menuCreateForm.SetMenuItemNavigationUrl(Core.ProcessController.Control.GetCreateFormExampleUrl(), "Loading Layout Example...");
            menuUsingStore.SetMenuItemNavigationUrl(Core.ProcessController.Communication.GetStoreExampleUrl(), "Loading Store Examples...");
            menuAuthorManage.SetMenuItemNavigationUrl(Core.ProcessController.Control.GetAuthorManageUrl(), "Loading Author Manage...");
            menuGridPanel.SetMenuItemNavigationUrl(Core.ProcessController.Control.GetGridPanelExampleUrl(), "Loading GridPanel Example...");
            menuBookEntry.SetMenuItemNavigationUrl(Core.ProcessController.FullExamples.GetBookEntryUrl(), "Loading Book Entry Example...");

            // set content load panel initial url
            pnlMain.AutoLoad.Url = Core.ProcessController.GetMainLandingUrl();
        }
    }
}
